<?php

use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //$this->call(UsersTableSeeder::class);

        //$this->seedUser();

        //$this->call(AreasTableSeeder::class);

    }


    protected function seedUser()
    {
        $items = [
            [
                'name' => '超级系统管理员',
                'account' => 'super',
                'userType' => 0,
                'state' =>1,
                'password' => bcrypt('888888'),
                'created_at' => date('Y-m-d H:i:s'),
                'updated_at' => date('Y-m-d H:i:s')
            ],
            [
                'name' => '系统管理员',
                'account' => 'admin',
                'userType' =>1,
                'state' =>1,
                'password' => bcrypt('888888'),
                'created_at' => date('Y-m-d H:i:s'),
                'updated_at' => date('Y-m-d H:i:s')
            ]
        ];
        DB::table('users')->insert($items);

        $items = [];
        for ($t=1;$t<=10;$t++){
            $items[] = [
                'name' => '会员'.$t,
                'account' => 'user'.$t,
                'userType' =>2,
                'password' => bcrypt('888888'),
                'state' =>1,
                'created_at' => date('Y-m-d H:i:s'),
                'updated_at' => date('Y-m-d H:i:s')
            ];
        }

        DB::table('users')->insert($items);
    }

}
